import React, { Component, lazy, Suspense } from 'react';
function lazyComponent(component){
    return class extends Component {
        render() { 
            const {props}=this;
            return (
                <>
                <Suspense fallback={<div>loading...</div>}>
                    <component  {...props}/>
                </Suspense>
                </>
            );
        }
    }
}
export default function (component){
    return lazyComponent(lazy(component))
}